.class public Luk/co/deanwild/materialshowcaseview/RectangleShape;
.super Ljava/lang/Object;
.source "RectangleShape.java"

# interfaces
.implements Luk/co/deanwild/materialshowcaseview/Shape;


# instance fields
.field private activity:Landroid/app/Activity;

.field private fullWidth:Z

.field private rect:Landroid/graphics/Rect;


# direct methods
.method public constructor <init>(Landroid/graphics/Rect;)V
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 18
    invoke-direct {p0, p1, v0, v1}, Luk/co/deanwild/materialshowcaseview/RectangleShape;-><init>(Landroid/graphics/Rect;Landroid/app/Activity;Z)V

    return-void
.end method

.method public constructor <init>(Landroid/graphics/Rect;Landroid/app/Activity;Z)V
    .locals 0

    .line 21
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 22
    iput-object p2, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->activity:Landroid/app/Activity;

    .line 23
    iput-boolean p3, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->fullWidth:Z

    const/4 p2, 0x0

    const/4 p3, 0x0

    .line 24
    invoke-static {p1, p2, p3}, Luk/co/deanwild/materialshowcaseview/RectangleShape;->getPreferredBounds(Landroid/graphics/Rect;Landroid/app/Activity;Z)Landroid/graphics/Rect;

    move-result-object p1

    iput-object p1, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->rect:Landroid/graphics/Rect;

    return-void
.end method

.method public static getDisplayMetrics(Landroid/app/Activity;)Landroid/util/DisplayMetrics;
    .locals 1

    .line 52
    new-instance v0, Landroid/util/DisplayMetrics;

    invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V

    .line 53
    invoke-virtual {p0}, Landroid/app/Activity;->getWindowManager()Landroid/view/WindowManager;

    move-result-object p0

    invoke-interface {p0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object p0

    invoke-virtual {p0, v0}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

    return-object v0
.end method

.method public static getPreferredBounds(Landroid/graphics/Rect;Landroid/app/Activity;Z)Landroid/graphics/Rect;
    .locals 4

    .line 43
    new-instance v0, Landroid/graphics/Rect;

    iget v1, p0, Landroid/graphics/Rect;->left:I

    add-int/lit8 v1, v1, -0xa

    iget v2, p0, Landroid/graphics/Rect;->top:I

    add-int/lit8 v2, v2, -0xa

    iget v3, p0, Landroid/graphics/Rect;->right:I

    add-int/lit8 v3, v3, 0xa

    iget p0, p0, Landroid/graphics/Rect;->bottom:I

    add-int/lit8 p0, p0, 0xa

    invoke-direct {v0, v1, v2, v3, p0}, Landroid/graphics/Rect;-><init>(IIII)V

    if-eqz p1, :cond_0

    if-eqz p2, :cond_0

    const/4 p0, 0x0

    .line 45
    iput p0, v0, Landroid/graphics/Rect;->left:I

    .line 46
    invoke-static {p1}, Luk/co/deanwild/materialshowcaseview/RectangleShape;->getDisplayMetrics(Landroid/app/Activity;)Landroid/util/DisplayMetrics;

    move-result-object p0

    iget p0, p0, Landroid/util/DisplayMetrics;->widthPixels:I

    iput p0, v0, Landroid/graphics/Rect;->right:I

    :cond_0
    return-object v0
.end method


# virtual methods
.method public draw(Landroid/graphics/Canvas;Landroid/graphics/Paint;II)V
    .locals 0

    .line 29
    iget-object p3, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->rect:Landroid/graphics/Rect;

    invoke-virtual {p1, p3, p2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    return-void
.end method

.method public pointInBounds(FFLuk/co/deanwild/materialshowcaseview/Target;)Z
    .locals 0

    .line 34
    iget-object p3, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->rect:Landroid/graphics/Rect;

    float-to-int p1, p1

    float-to-int p2, p2

    invoke-virtual {p3, p1, p2}, Landroid/graphics/Rect;->contains(II)Z

    move-result p1

    return p1
.end method

.method public updateTarget(Luk/co/deanwild/materialshowcaseview/Target;)V
    .locals 2

    .line 39
    invoke-interface {p1}, Luk/co/deanwild/materialshowcaseview/Target;->getBounds()Landroid/graphics/Rect;

    move-result-object p1

    iget-object v0, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->activity:Landroid/app/Activity;

    iget-boolean v1, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->fullWidth:Z

    invoke-static {p1, v0, v1}, Luk/co/deanwild/materialshowcaseview/RectangleShape;->getPreferredBounds(Landroid/graphics/Rect;Landroid/app/Activity;Z)Landroid/graphics/Rect;

    move-result-object p1

    iput-object p1, p0, Luk/co/deanwild/materialshowcaseview/RectangleShape;->rect:Landroid/graphics/Rect;

    return-void
.end method
